import { ReplyModel } from '@/api/custcare/reply/ReplyModel'
import { reactive } from 'vue'

export default function useBaseModel() {
    //表单绑定的数据
    const addModel = reactive<ReplyModel>({
        id: '',
        editType: '',
        status: '1',
        key_words: '',
        question: '',
        content: '',
        img: '',
        group_id: 1,
        sort: 1
    })
    //表单验证规则
    const rules = reactive({
        // key_words: [
        //     {
        //         required: true,
        //         trigger: 'blur',
        //         message: '请填写自动回复关键字'
        //     },
        //     { min: 2, max: 50, message: '长度为2-50个字符', trigger: 'blur' }
        // ],
        // question: [
        //     {
        //         required: true,
        //         trigger: 'blur',
        //         message: '请填写自动回复问题'
        //     },
        //     { min: 2, max: 50, message: '长度为2-50个字符', trigger: 'blur' }
        // ],
        content: [
            {
                required: true,
                trigger: 'blur',
                message: '请填写自动回复内容'
            },
            { min: 2, message: '长度为2个字符以上', trigger: 'blur' }
        ]
    })

    return {
        addModel,
        rules
    }
}
